#ifndef __SPECULATIVECOUNTER_H__
#define __SPECULATIVECOUNTER_H__

#include "base/Counter.h"
#include "util/Pool.h"

class SpeculativeCounter : public Counter
{
  public:
    NEW_DELETE_OPERATORS_H(SpeculativeCounter,Counter);
    SpeculativeCounter (const char* _outName, const char* _outRollbackName);
    ~SpeculativeCounter ();
    void increment (bool isSpeculative, uint amount = 1);
    void commit ();
    void rollback ();
    void clear ();

  protected:
    friend class StatisticsCollection;
    const char* outputRollbackName;
    uint64 valueSpeculative;
    uint64 valueRollback;
};

#endif /* __SPECULATIVE_COUNTER__ */
